/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Easy.table;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author DR.HUY
 */
@Embeddable
public class OrderDetailPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "OrderID", nullable = false)
    private int orderID;
    @Basic(optional = false)
    @Column(name = "TicketID", nullable = false)
    private int ticketID;

    public OrderDetailPK() {
    }

    public OrderDetailPK(int orderID, int ticketID) {
        this.orderID = orderID;
        this.ticketID = ticketID;
    }

    public int getOrderID() {
        return orderID;
    }

    public void setOrderID(int orderID) {
        this.orderID = orderID;
    }

    public int getTicketID() {
        return ticketID;
    }

    public void setTicketID(int ticketID) {
        this.ticketID = ticketID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) orderID;
        hash += (int) ticketID;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderDetailPK)) {
            return false;
        }
        OrderDetailPK other = (OrderDetailPK) object;
        if (this.orderID != other.orderID) {
            return false;
        }
        if (this.ticketID != other.ticketID) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Easy.table.OrderDetailPK[orderID=" + orderID + ", ticketID=" + ticketID + "]";
    }

}
